02.05.2011, 13:21
Hey, I'm trying to create a command that when you type /ptc <playerid> <vehicleid> it teleports the player into the vehicle specified. I've been at this for hours, asking friends to have a look with no prevail.
As you can see I used zcmd + sscanf, both have been defined and all. Any help would be greatly appreciated.
pawn Код:
CMD:ptc(playerid, vehicleid, params[])
{
new vehid,pName[25];
if(sscanf(params,"ui",pName, vehid)) return SendClientMessage(playerid, COLOR_RED, "Usage: /ptc <playerid> <vehicleid>");
else if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found");
else
{
GetVehicleModel(vehicleid);
GetPlayerName(playerid, pName,25);
PutPlayerInVehicle(playerid, vehid, 0);
new string[70];
format(string,sizeof(string),"You moved %s to the vehicle %d",playerid,vehicleid);
SendClientMessage(playerid, 0x00FF00AA, string);}
return 1;
}