Problem
#1

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!");
Reply
#2

Show us the whole script, problem is not in this
Reply
#3

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;
}
Reply
#4

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;
}
Reply
#5

Thanks! its working now
Reply
#6

nvm!
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)