errors -_-
#1

got some errors while making a /givecar [id] [carid] and got these errors -_-


C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(64) : error 035: argument type mismatch (argument 2)
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(5 : warning 204: symbol is assigned a value that is never used: "car"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

my code:
pawn Код:
CMD:givecar(playerid,params[])
{
   
    new carid;
    new id;
    new string[128];
    new Float:X, Float:Y, Float:Z, Float:angle;
    new car = CreateVehicle(carid, X, Y, Z, angle, 0, 1, 60);
    if(sscanf(params,"ir",carid, id)) return SendClientMessage(playerid,-1,"Error: - /givecar [id]"); // checking does sscanf found integer parameter
    GetPlayerPos(id, X, Y, Z);
    GetPlayerFacingAngle(id, angle);
    PutPlayerInVehicle(id, carid, 0);
    format(string, sizeof(string), "the admin has chose %s as the event car", GetPlayerVehicleID(playerid));
    SendClientMessageToAll(playerid, -1, string);
    return 1;
}
sorry if i did something wrong -_- im still learning
Reply
#2

pawn Код:
CMD:givecar(playerid,params[])
{
   
    new carid;
    new id;
    new string[128];
    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);
    format(string, sizeof(string), "the admin has chose %s as the event car", GetPlayerVehicleID(playerid));
    SendClientMessageToAll(string);
    return 1;
}
I have corrected it. Try:
Reply
#3

ok i got rid of the warning thanks but the error remains
Reply
#4

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
ok i got rid of the warning thanks but the error remains
what error? did the line of error change?
Reply
#5

One more correction:

pawn Код:
CMD:givecar(playerid,params[])
{
   
    new carid;
    new id;
    new string[128];
    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);
    format(string, sizeof(string), "the admin has chose %s as the event car", GetPlayerVehicleID(playerid));
    SendClientMessageToAll(0xFFCC00FF, string);
    return 1;
}
Reply
#6

nvm its warning's i can live with them thanks +rep
Reply
#7

Okay the code tells me your giving them a Car ID that is already spawned, so why are you going through the hassle of creating another car?.
Reply
#8

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Okay the code tells me your giving them a Car ID that is already spawned, so why are you going through the hassle of creating another car?.
oh i must of done something wrong lol, i was supposed to make cmd /givecar [id] [carmodelid] so if i do /givecar 0 444 it will give id 0 a monster truck + when i went in-game and tested got server error msg -_-
Reply
#9

ok so what didi i do wrong?
Reply
#10

bump D
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)