SA-MP Forums Archive
errors -_- - 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: errors -_- (/showthread.php?tid=346950)



errors -_- - thefatshizms - 30.05.2012

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


Re: errors -_- - pasha97 - 30.05.2012

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:


Re: errors -_- - thefatshizms - 30.05.2012

ok i got rid of the warning thanks but the error remains


Re: errors -_- - pasha97 - 30.05.2012

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?


Re: errors -_- - pasha97 - 30.05.2012

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



Re: errors -_- - thefatshizms - 30.05.2012

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


Re: errors -_- - IceCube! - 30.05.2012

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?.


Re: errors -_- - thefatshizms - 30.05.2012

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 -_-


Re: errors -_- - thefatshizms - 30.05.2012

ok so what didi i do wrong?


Re: errors -_- - thefatshizms - 30.05.2012

bump D