Error help - 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: Error help (
/showthread.php?tid=532259)
Error help -
Rabea - 17.08.2014
okay i made /giveweaponlicense command but they give me error.
in this line :
Код:
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweaponlicense [playerid]");
and the error is
Код:
(9434) : error 035: argument type mismatch (argument 1)
Command:
Код:
CMD:giveweaponlicense(playerid, parmas[])
{
new params, string[64], playerb;
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweaponlicense [playerid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(!IsAARMY(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not the general");
if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a the general");
if(!PlayerInfo[playerid][pFireArmsLic]) return SendClientMessage(playerid, COLOR_GREY, "The player already have weapon license");
PlayerInfo[playerid][pFireArmsLic] = 1;
format(string, sizeof(string), " You have given %s a weapon license.", NORPN(playerb));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), " The general %s has given you a weapon license.", NORPN(playerid));
SendClientMessage(playerb, COLOR_WHITE, string);
return 1;
}
anyone can help me?
Re: Error help -
iOxide - 17.08.2014
Why do you have that another params variable defined? Remove it, you don't need to make a new var for it.
Re: Error help -
Rabea - 17.08.2014
error 017: undefined symbol "params"
Re: Error help -
Stinged - 17.08.2014
Remove new params and write params instead of parmas in CMD:giveweaponlicense
Re: Error help -
Rabea - 17.08.2014
Thanks, what about this command,
Error:
Код:
(9204 -- 9223) : error 010: invalid function or declaration
Command:
Код:
CMD:getin(playerid, params[])
{
new IsPlayerInEVehicle[MAX_PLAYERS];
new Seats[MAX_VEHICLES];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
for(new i=0; i < 1750; i++)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(i, X,Y,Z);
new vehiclename[24]; //here
if(!IsPlayerInRangeOfPoint(playerid, 7.0, X,Y,Z)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the cityhall.");
if(IsAnEnterableModel(i))
if(IsPlayerInEVehicle[playerid] == 9999 && !IsPlayerInAnyVehicle(playerid))
if(IsAnEnterableCar(i) && Seats[i] <= 5)
{
PutPlayerInVehicle(playerid, i, 4);
Seats[i] ++;
SendClientMessage(playerid, COLOR_GREY,"* You have Entered a Vehicle with /getin, Use /getout to get out or else YOU WILL CRASH!!");
return 1;
}
else if(IsAnEnterablePlane(i))
{
PutPlayerInVehicle(playerid, i, 4);
IsPlayerInEVehicle[playerid] = i;
SendClientMessage(playerid, COLOR_GREY,"* You have Entered a Vehicle with /getin, Use /getout to get out or else YOU WILL CRASH!!");
}
}
}
return 1; //to here
}
Re: Error help -
Rabea - 17.08.2014
anyone?
Re: Error help -
Rabea - 18.08.2014
bump