SA-MP Forums Archive
help with this cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help with this cmd (/showthread.php?tid=380403)



help with this cmd - RyanPetersons - 25.09.2012

pawn Код:
CMD:spawnveh(playerid, params[])
{
    new id, Float:pos[4], col[2];
    new inputtext[40];
    new modelid = strval(inputtext);
    if(sscanf(params, "ii", modelid, col[0], col[1])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehicleid] [color1] [color2]");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"You are not in any vehicle to whom you want to change");
    new vehicleid = GetPlayerVehicleID(playerid);
    DestroyVehicle(vehicleid);
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    vipcar = CreateVehicle(modelid, pos[0], pos[1], pos[2], pos[3], col[0], col[1], 1200);
    PutPlayerInVehicle(playerid,vipcar,1);
    //format(string, sizeof(string), "AdmWarn: %s has spawned a vehicle model %d.", RPN(playerid), id);
    //SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}
This cmd works properly, but this cmd doesnt spawns the vehicle.. that is the problem only, overall it works.