script help
#1

i compile this code

CMD:givegun(playerid, params[]){
new wid, ammo, str[128], pName[MAX_PLAYER_NAME];
if(sscanf(params, "ui", wid, ammo)) return SendClientMessage(playerid, -1, "USAGE: /givegun [weapon id] [ammo]");
if(wid == 3 return SendClientMessage(playerid, 0xFF0000, "ERROR: weapond id 38 is forbidden");
GetPlayerName(playerid, pName, sizeof(pName));
GivePlayerWeapon(playerid, wid, ammo);
format(str,sizeof(str),"You got Weapon ID %i",wid);
SendClientMessage(playerid, 0xf8f8f8fff, str);
return 1;
}

when i compile it i got the code is ok

but when i run the server is crash

help RyderX

p.sorry for my bad english
Reply
#2

Quote:
Originally Posted by crukk11
Посмотреть сообщение
i compile this code

CMD:givegun(playerid, params[]){
new wid, ammo, str[128], pName[MAX_PLAYER_NAME];
if(sscanf(params, "ui", wid, ammo)) return SendClientMessage(playerid, -1, "USAGE: /givegun [weapon id] [ammo]");
if(wid == 3 return SendClientMessage(playerid, 0xFF0000, "ERROR: weapond id 38 is forbidden");
GetPlayerName(playerid, pName, sizeof(pName));
GivePlayerWeapon(playerid, wid, ammo);
format(str,sizeof(str),"You got Weapon ID %i",wid);
SendClientMessage(playerid, 0xf8f8f8fff, str);
return 1;
}

when i compile it i got the code is ok

but when i run the server is crash

help RyderX

p.sorry for my bad english
PHP код:
CMD:givegun(playeridparams[]){  
    new 
widammostr[128], pName[MAX_PLAYER_NAME];  
    if(
sscanf(params"ui",  widammo)) return SendClientMessage(playerid, -1"USAGE: /givegun [weapon id] [ammo]");  
    if(
wid == 38) return SendClientMessage(playerid0xFF0000"ERROR: weapond id 38 is forbidden");  
    
GetPlayerName(playeridpNamesizeof(pName));  
    
GivePlayerWeapon(playeridwidammo);  
    
format(str,sizeof(str),"You got Weapon ID %i With %i Ammo",wid,ammo); 
    
SendClientMessage(playerid0xf8f8f8fffstr); 
    return 
1;  

Try now
Reply
#3

same crash

it say script [Gamemode/GL]: Run Time error 19: ''File or function is not found''
Reply
#4

Probably sscanf plugin is not loaded.
Reply
#5

not work
Reply
#6

Crukk1 can you copy all , server-log.txt to here let me see it
Reply
#7

when i enter the command it nothing happen

thank rdx for your help
Reply
#8

The crash is not from your code. It's because one of dependencies are not loaded. Most probably its sscanf or the file itself.
Reply
#9

Quote:
Originally Posted by crukk11
Посмотреть сообщение
when i enter the command it nothing happen

thank rdx for your help
So it works?
Reply
#10

it work but the command nothing happen when i enter it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)