SA-MP Forums Archive
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: Problem (/showthread.php?tid=540037)



Problem - Youssef214 - 02.10.2014

When someone types a command I want to send a message to him, he is under spawn protection, and then it disallows him to type any command,

why this doesn't work? it sends the message and in the same time it performs the command it its correct.

Under OnPlayerCommandPerformed:
pawn Код:
if(Spawnprotection[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Type Any Command While In Spawn Protection!");



Re: Problem - Rudy_ - 02.10.2014

Show us the whole script, problem is not in this


Re: Problem - Youssef214 - 02.10.2014

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Command! See The Avaliable Commands Here: /cmds.");
    if(Info[playerid][Muted] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Are Muted, You Cannot Type Any Command!");
    if(Spawnprotection[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Type Any Command While In Spawn Protection!");
    return 1;
}



Re: Problem - Rudy_ - 02.10.2014

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Command! See The Avaliable Commands Here: /cmds.");
    if(Info[playerid][Muted] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Are Muted, You Cannot Type Any Command!");
    if(Spawnprotection[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Type Any Command While In Spawn Protection!");
    return 0;
}
Edit: Try this

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Command! See The Avaliable Commands Here: /cmds.");
    if(Info[playerid][Muted] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Are Muted, You Cannot Type Any Command!");
    if(Spawnprotection[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Type Any Command While In Spawn Protection!"), 0;
    return 1;
}



Re: Problem - Youssef214 - 02.10.2014

Thanks! its working now


Re: Problem - Eth - 02.10.2014

nvm!


Re: Problem - Youssef214 - 02.10.2014

actually, this gave me another problem, in my linux server, when i try to use a command it sends Server:Unknown Command