SA-MP Forums Archive
Faulty command [help please] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Faulty command [help please] (/showthread.php?tid=211809)



Faulty command [help please] - darkknight123 - 16.01.2011

im trying to script in /asslick (im shure most of you know what that is) and when i try /asslick in game it allways asslicks id 0 and then i try a command that dosnt exist it asslicks id 0 i dont know what im doing wrong please help

Quote:

#include <a_samp>
#include strtok


public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
if (strcmp("/asslick", cmdtext, true))
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, 0x919191FF, "Usage: /asslick [id]");
if(IsPlayerConnected(otherplayer))
{
new string[64], name[MAX_PLAYER_NAME];
new otherplayername[30];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(otherplayer, otherplayername, sizeof(otherplayername));
format(string, sizeof(string), " %s Is now asslicking %s", name,otherplayername);
SendClientMessageToAll(0x33CCFFAA, string);
SendClientMessage(playerid,0xFFFFFFFF,"Heres 10000000 Dollers for your trubles ");
GivePlayerMoney(playerid, 100000000);
sleep(20);
SendClientMessage(playerid,0xFFFFFFFF,"wait never mind I want that money back!");
GivePlayerMoney(playerid,-100000000);
}
else
{
SendClientMessage(playerid,0xFFFFFFFF, "Haha!, The Player you are trying to asslick isn't online! noob.");
}
return 1;
}
return 0;
}




Re: Faulty command [help please] - PeteShag - 16.01.2011

pawn Код:
CMD:asslick(playerid, params[])
{
    new Giveplayerid, name[32], name2[32];
    if(sscanf(params, "d", Giveplayerid)) SendClientMessage(playerid,0x919191FF, "Usage: /asslick [id]");
    else if (!IsPlayerConnected(Giveplayerid)) SendClientMessage(playerid,0xFFFFFFFF, "Haha!, The Player you are trying to asslick isn't online! noob");
    if(IsPlayerConnected(Giveplayerid))
    {
        GetPlayerName(playerid, Name, 32);
        GetPlayerName(Giveplayerid, Name2, 32);
        format(string, sizeof(string), " %s Is now asslicking %s", name,Name2);
        SendClientMessageToAll(0x33CCFFAA, string);
        SendClientMessage(playerid,0xFFFFFFFF,"Heres 10000000 Dollers for your trubles ");
        GivePlayerMoney(playerid, 100000000);
        sleep(20);
        SendClientMessage(playerid,0xFFFFFFFF,"wait never mind I want that money back!");
        GivePlayerMoney(playerid,-100000000);
        }
 }
or smth like that.


Re: Faulty command [help please] - darkknight123 - 16.01.2011

I get these errors >.<
Quote:

C:\Documents and Settings\gamer\Desktop\sdfad\asslick.pwn(16) : error 017: undefined symbol "Name"
C:\Documents and Settings\gamer\Desktop\sdfad\asslick.pwn(17) : error 017: undefined symbol "Name2"
C:\Documents and Settings\gamer\Desktop\sdfad\asslick.pwn(18) : error 017: undefined symbol "string"
C:\Documents and Settings\gamer\Desktop\sdfad\asslick.pwn(18) : error 017: undefined symbol "string"
C:\Documents and Settings\gamer\Desktop\sdfad\asslick.pwn(18) : error 029: invalid expression, assumed zero
C:\Documents and Settings\gamer\Desktop\sdfad\asslick.pwn(18) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.