SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/05/2014, 04:12 PM   #1
TheSimpleGuy
Huge Clucker
 
TheSimpleGuy's Avatar
 
Join Date: Apr 2014
Posts: 223
Reputation: 27
Default Server crashing

pawn Code:
CMD:mute(playerid, params[])
{
    new id, reason, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[256];
    if(PlayerInfo[playerid][pAdmin] >= 4) {
    if(sscanf(params,"ds",id,reason)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /mute [id] [reason]");
    if(id==playerid) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot mute yourself!");
    if(id==INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player is not connected!");
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(id, name2, sizeof(name2));
    format(string, sizeof(string), "%s [%d] has muted %s [%d]. Reason: %s",name1,playerid,name2,id,reason);
    SendClientMessageToAll(0xFF0000FF, string);
    Mute[id] = 1;
    } else SendClientMessage(playerid, 0xFF0000FF, "ERROR: You do not have the privilege to access this command!");
    return 1;
}

Server is crashing after I use the command. What is wrong?
TheSimpleGuy is offline   Reply With Quote
Old 04/05/2014, 04:13 PM   #2
PrivatioBoni
Gangsta
 
Join Date: May 2013
Location: Ya
Posts: 962
Reputation: 162
Default Re: Server crashing

pawn Code:
new reason[64];
if(sscanf(params,"ds[64]",id,reason))

See what happens.
PrivatioBoni is offline   Reply With Quote
Old 04/05/2014, 04:14 PM   #3
TheSimpleGuy
Huge Clucker
 
TheSimpleGuy's Avatar
 
Join Date: Apr 2014
Posts: 223
Reputation: 27
Default Re: Server crashing

Oh shit, I forgot to add the reason value. Thanks!
TheSimpleGuy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[need help]Server's crashing Zicka Scripting Help 14 27/02/2014 04:13 PM
Server crashing Captain_jeffree95 Server Support 3 28/01/2014 04:22 PM
Server Crashing BodyBoardVEVO Server Support 11 09/01/2014 03:14 PM
Why is this crashing my server? hydravink Scripting Help 7 11/01/2013 11:04 PM
Server keeps Crashing VANSman Server Support 1 15/05/2011 11:28 AM


All times are GMT. The time now is 10:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.