/givecar doesnt work
#1

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
Reply
#2

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;
}
Reply
#3

still get the error message -_-
Reply
#4

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

server:unkown command
Reply
#6

Are you using any filterscripts? Try removing them.
Reply
#7

Nope that's the only FS
Reply
#8

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

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

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;
    }
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)