Server Closed connection
#6

Quote:
Originally Posted by karan007
Посмотреть сообщение
Try this.
PHP код:
CMD:givegun(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playeridCOLOR_RED" You are not authorized to use that command !");
    new 
giveplayeridweaponid;
    if(
weaponid == 38) return SendClientMessageEx(playeridCOLOR_RED"You cannot give anyone a minigun!");
    if(
sscanf(params"ud"giveplayeridweaponid))
    {
        
SendClientMessage(playeridCOLOR_WHITE"Syntax:givegun [player] [weaponid]");
    }
    return 
1;

You do the same mistake too.

"weaponid" is 0 because it has not been updated with sscanf (it should be before the check):
PHP код:
CMD:givegun(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playeridCOLOR_RED" You are not authorized to use that command !");
    new 
giveplayeridweaponid;
    if(
sscanf(params"ud"giveplayeridweaponid)) return SendClientMessage(playeridCOLOR_WHITE"Syntax:givegun [player] [weaponid]");
    if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessageEx(playeridCOLOR_RED"Offline player");
    if(!(
<= weaponid <= 46))  return SendClientMessageEx(playeridCOLOR_RED"Invalid weaponid");
    if(
weaponid == 38) return SendClientMessageEx(playeridCOLOR_RED"You cannot give anyone a minigun!");
    
GivePlayerGun(giveplayeridweaponid50);
    return 
1;

EDIT: Oh, you got it fixed.
Reply


Messages In This Thread
Server Closed connection - by IndependentGaming - 04.05.2015, 12:20
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:47
Re: Server Closed connection - by giorgosdim12 - 04.05.2015, 12:48
Re: Server Closed connection - by Karan007 - 04.05.2015, 12:49
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:50
Re: Server Closed connection - by Konstantinos - 04.05.2015, 12:51
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:56
Re: Server Closed connection - by Threshold - 04.05.2015, 12:58
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:59

Forum Jump:


Users browsing this thread: 3 Guest(s)