SA-MP Forums Archive
/givecar doesnt work - 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: /givecar doesnt work (/showthread.php?tid=347134)



/givecar doesnt work - thefatshizms - 31.05.2012

i made this cmd :
pawn Код:
CMD:givecar(playerid,params[])
{

    new carid;
    new id;
    new Float:X, Float:Y, Float:Z, Float:angle;
    if(sscanf(params,"ir",carid, id)) return SendClientMessage(playerid,-1,"Error: - /givecar [car id] [player id]"); // checking does sscanf found integer parameter
    GetPlayerPos(id, X, Y, Z);
    GetPlayerFacingAngle(id, angle);
    CreateVehicle(carid, X, Y, Z, angle, 0, 1, 60);
    PutPlayerInVehicle(id, carid, 0);
    return 1;
}
it displays no errors but when i test in game i get the server error message


Re: /givecar doesnt work - HuSs3n - 31.05.2012

pawn Код:
CMD:givecar(playerid,params[])
{
    new carid;
    new id;
    new Float:X, Float:Y, Float:Z, Float:angle;
    if(sscanf(params,"du",carid, id)) return SendClientMessage(playerid,-1,"Error: - /givecar [car id] [player id]"); // checking does sscanf found integer parameter
    GetPlayerPos(id, X, Y, Z);
    GetPlayerFacingAngle(id, angle);
    CreateVehicle(carid, X, Y, Z, angle, 0, 1, 60);
    PutPlayerInVehicle(id, carid, 0);
    return 1;
}



Re: /givecar doesnt work - thefatshizms - 31.05.2012

still get the error message -_-


Re: /givecar doesnt work - MadeMan - 31.05.2012

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
still get the error message -_-
What error message?


Re: /givecar doesnt work - thefatshizms - 31.05.2012

server:unkown command


Re: /givecar doesnt work - MadeMan - 01.06.2012

Are you using any filterscripts? Try removing them.


Re: /givecar doesnt work - thefatshizms - 01.06.2012

Nope that's the only FS


Re: /givecar doesnt work - MadeMan - 01.06.2012

So you type '/givecar' and it gives the "server:unkown command" message?


Re: /givecar doesnt work - thefatshizms - 01.06.2012

Yes I do /givecar got error message I also get error message when I try to give myself A car


Re: /givecar doesnt work - [D]ry[D]esert - 01.06.2012

Try this:
pawn Код:
COMMAND:veh(playerid,params[])
    {

    new Float:X,Float:Y,Float:Z;
    new pName[MAX_PLAYER_NAME];
    if(sscanf(params,"ddd", vehid,Colorone,Colortwo)) return SendClientMessage(playerid, COLOR_WHITE, ""WHITE" Usage: "GREEN"/veh "WHITE"[vehid] [COLOR1] [COLOR2]");
    if(vehid < 400 ||vehid > 611) return SendClientMessage(playerid, COLOR_WHITE,"Veh id can't be below 400 or above 611");
    GetPlayerName(playerid, pName ,sizeof(pName));
    GetPlayerPos(playerid,X,Y,Z);
    new str[128];
    format(str , sizeof(str),"%s has create vehicle id %d ,Color1[%d],Color2[%d]",pName,vehid,Colorone,Colortwo);
    CreateVehicle(vehid,X,Y,Z,0,Colorone,Colortwo,false);
    SendClientMessageToAll(COLOR_LIGHTBLUE, str);
    return 1;
    }