Help with player to vehicle command
#1

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.
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;
}
As you can see I used zcmd + sscanf, both have been defined and all. Any help would be greatly appreciated.
Reply


Messages In This Thread
Help with player to vehicle command - by Boxlo_Junior - 02.05.2011, 13:21
Re: Help with player to vehicle command - by Zh3r0 - 02.05.2011, 13:30
Re: Help with player to vehicle command - by Boxlo_Junior - 02.05.2011, 13:40

Forum Jump:


Users browsing this thread: 2 Guest(s)