Quote:
Originally Posted by Ghett0
I THINK he means the ability to kidnap someone if they're in your car. You'll need strtok for this:
pawn Код:
if(strcmp(cmd, "/kidnap", true) == 0) { 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(cmdtext)) 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; }
There's a 1/10 chance you'll successfully kidnap.
|
Hey man,
I take part of your code and put in my own way.
There's a little warning, check this out:
Код:
warning 202: number of arguments does not match definition
Follow the line, where is getting warning:
Код:
if(!IsPlayerInVehicle(GetPlayerVehicleID(playerid))){
SendClientMessage(playerid, COLOR_YELLOW, "Message here");
return 1;
}
You know what is?