Posts: 303
Threads: 71
Joined: Mar 2011
pawn Код:
CMD:kidnap(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000, "You must be in a vehicle to kidnap someone!");
new KidnapID = strval(strtok(cmd, idx));
if(!IsPlayerConnected(KidnapID) || IsNumeric(params)) return SendClientMessage(playerid, 0xFF0000, "That's an invalid ID.");
if(!IsPlayerInVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000, "That player isn't in your car.");
if(random(10) == 1)
new PName[MAX_PLAYER_NAME];
new KidnapString[40];
{
SendClientMessage(playerid, 0xFFFF00, "The kidnap was successful.");
GetPlayerName(playerid, PName, sizeof(PName));
format(KidnapString, sizeof(KidnapString), "%s has kidnapped you!", PName);
SendClientMessage(KidnapID, 0xFF0000, KidnapString);
}
else
{
GetPlayerName(KidnapID, PName, sizeof(PName));
format(KidnapString, sizeof(KidnapString), The kidnap failed and %s noticed you tried to kidnap him!", PName);
SendClientMessage(KidnapID, 0xFF0000, KidnapString);
GetPlayerName(playerid, PName, sizeof(PName));
format(KidnapString, sizeof(KidnapString), "%s has attempted to kidnap you!", PName);
SendClientMessage(KidnapID, 0xFF0000, KidnapString);
}
return 1;
}
I'm stuck. Please help? +REP
Posts: 303
Threads: 71
Joined: Mar 2011
Okay well here is what I get:
Код:
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8903) : error 017: undefined symbol "cmd"
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8904) : error 017: undefined symbol "IsNumeric"
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8905) : warning 202: number of arguments does not match definition
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8907) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8907) : error 017: undefined symbol "PName"
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8907) : warning 215: expression has no effect
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8907) : error 001: expected token: ";", but found "]"
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(8907) : fatal error 107: too many error messages on one line
Posts: 1,905
Threads: 63
Joined: Oct 2011
Reputation:
0
You're not even asking how to do it. You just want code. It puzzles me why you are so clueless on sa-mp scripting, and yet you try to tackle commands like this. Learn the basics first, damn.
Posts: 303
Threads: 71
Joined: Mar 2011
Do you even understand me? I'm obviously asking how to fix it and what I'm doing wrong.
Posts: 303
Threads: 71
Joined: Mar 2011
Posts: 303
Threads: 71
Joined: Mar 2011
Thanks but it gives me this error:
Код:
error 017: undefined symbol "IsNumeric"
EDIT: Nevermind I got it! just changd IsNumeric to isNumeric.