In game ID problem - 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: In game ID problem (
/showthread.php?tid=333075)
In game ID problem -
RenSoprano - 10.04.2012
Hello I have problem with IDs in game when I try to teleport ID 3 it teleport ID 0
And I have problem with Givegun command when
I try to give gun its only show text but no give weapon
This is Command GiveGun
pawn Код:
CMD:givegun(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new target, gun, string[128];
if(sscanf(params, "ud", target, gun))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: /givegun <playerid> <gun>");
return 1;
}
if(gun < 1 || gun > 47) { SendClientMessage(playerid, COLOR_GREY, "Don't go below 1 or above 47."); return 1; }
if(IsPlayerConnected(target))
{
if(target != INVALID_PLAYER_ID && gun <= 20 || gun >= 22)
{
GivePlayerValidWeapon(target, gun, 50000);
format(string, sizeof(string), "Admin %s has given you a weapon.", GetName(playerid));
SendClientMessage(target, COLOR_GREY, string);
format(string, sizeof(string), "You have given %s a weapon.", GetName(target));
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
return 1;
}
return 1;
}
Re: In game ID problem -
ikey07 - 10.04.2012
if(sscanf(params, "ud", target, gun))
Re: In game ID problem -
RenSoprano - 10.04.2012
How I can repair problem with ID in game
Re: In game ID problem -
tyler12 - 10.04.2012
update sscanf..
Re: In game ID problem -
RenSoprano - 10.04.2012
I fix Command /givegun but when I try to give gun to any player it doesn't gives a weapon
pawn Код:
CMD:givegun(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new target, gun, string[128];
if(sscanf(params, "ud", target, gun))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: /givegun <playerid> <gun>");
return 1;
}
if(gun < 1 || gun > 47) { SendClientMessage(playerid, COLOR_GREY, "Don't go below 1 or above 47."); return 1; }
if(IsPlayerConnected(target))
{
if(target != INVALID_PLAYER_ID && gun <= 20 || gun >= 22)
{
GivePlayerValidWeapon(target, gun, 50000);
format(string, sizeof(string), "Admin %s has given you a weapon.", GetName(playerid));
SendClientMessage(target, COLOR_GREY, string);
format(string, sizeof(string), "You have given %s a weapon.", GetName(target));
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
return 1;
}
return 1;
}