![]() |
|
[Pawn] Help me - Printable Version +- open.mp forum (https://forum.open.mp) +-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) +--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) +--- Thread: [Pawn] Help me (/showthread.php?tid=2869) |
Help me - tuankhanqsamp - 2024-08-21 [113064] Warning 209 : 209: function should return a valu //safezone forward LoadPlayer(); public LoadPlayer() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(Loaded[i] == 1) { TogglePlayerControllable(i,true); Loaded[i] = 0; return 1; } } } } [116252] Warning 202: number of arguments does not match definition CMD:laytoado(playerid, params[]) { new string[128]; new tstring[50]; new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); format(string, sizeof(string), "%0.2f, %0.2f, %0.2f", x, y, z); format(tstring, sizeof(tstring), "-------------------------"); Log("logs/toado.log", string, tstring); SendClientMessage(playerid, COLOR_WHITE, "Ban Da Lay Toa Do Vao (( Sciptfile>logs>an vao file toado.log de lay toa do nhe ))."); return 1; } RE: Help me - contatofelipeojustin - 2024-08-25 Sou novo no Open.MP e no Qawno, estou querendo fazer um servidor de fugas e pvp. Testei um sistema de criar motos bem básico, mas não estou tendo resultado na criação da moto, o sistema funciona com base no comando: /moto (utilizei a include do zcmd), esse comando abre uma dialog que é possivel escolher uma moto, mas não cria a moto. Alguem pode me ajuda? Meu Código(coloqueias partes principais): Code: #include <open.mp>
#include <a_samp>
#include <zcmd>
new Float:PlayerX;
new Float:PlayerY;
new Float:PlayerZ;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == ESCOLHER_MOTOS)
{
if(response)
{
switch(listitem)
{
case 0:
{
// Obtém a posição e o ângulo do jogador
GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
new Float:PlayerAngle;
GetPlayerFacingAngle(playerid, PlayerAngle);
// Calcula a nova posição na frente do jogador
new Float:OffsetX, Float:OffsetY, Float:OffsetZ = 1.0; // Um pouco acima
OffsetX = PlayerX + (3.0 * floatsin(-PlayerAngle, degrees)); // 3 unidades na frente
OffsetY = PlayerY + (3.0 * floatcos(-PlayerAngle, degrees)); // 3 unidades na frente
// Envia uma mensagem ao jogador com as novas coordenadas
new str[128];
format(str, sizeof(str), "Nova posição para criar a moto: X: %f, Y: %f, Z: %f", OffsetX, OffsetY, PlayerZ + OffsetZ);
SendClientMessage(playerid, -1, str);
// Cria o veículo na nova posição
new vehicleid = AddStaticVehicleEx(522, OffsetX, OffsetY, PlayerZ + OffsetZ, PlayerAngle, -1, -1, 1000, false);
// Verifica se o veículo foi criado com sucesso
if(vehicleid == INVALID_VEHICLE_ID)
{
SendClientMessage(playerid, -1, "Falha ao criar a moto.");
}
else
{
SendClientMessage(playerid, -1, "Moto NRG-500 criada com sucesso.");
}
}
}
}
}
return 1;
}
CMD:moto(playerid)
{
ShowPlayerDialog(playerid, 876, DIALOG_STYLE_LIST, "Motos", "NRG-500", "Selecionar", "Cancelar");
return 1;
} |