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



Scripting issues :( - jotan. - 16.09.2011

Hello
Im workin on project of gamemode from scratch,thats my 1st gamemode,
and I made some sort of command, /rules
But when I etc type random /xD it types rules on the screen
Heres all onPlayerCommandText


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
SetPlayerHealth(playerid, 00.0);


if(strcmp("/ls",cmdtext, true, 10) == 0)
SetPlayerPos(playerid,2498.8965,-1684.7239,13.4232,8.3983);

if (strcmp("/rules", cmdtext, true, 10) == 0)
SendClientMessage(playerid, 0xFF0000AA," Rules");
SendClientMessage(playerid, 0xFF0000AA,"<> Do not flame,abuse bugs,cheat.Always respect admins and listen to rules:");
SendClientMessage(playerid, 0xFF0000AA,"<> Do Not Break The Rules or You Can Get Punished");
return 1;
}


Re: Scripting issues :( - Jafet_Macario - 16.09.2011

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/kill", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth(playerid, 00.0);
        return 1;
    }
    if(strcmp("/ls",cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid,2498.8965,-1684.7239,13.4232); // Also here just X Y Z coordinates
        return 1;
    }
    if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFF0000AA," Rules");
        SendClientMessage(playerid, 0xFF0000AA,"<> Do not flame,abuse bugs,cheat.Always respect admins and listen to rules:");
        SendClientMessage(playerid, 0xFF0000AA,"<> Do Not Break The Rules or You Can Get Punished");
        return 1;
    }
    return 0;
}
Next time use pawn tags. [pawn] text here [/pawn]