help please
#1

im trying to script this command

Quote:

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];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " %s Is now asslicking %d", name);
SendClientMessageToAll(0x33CCFFAA, string);
SendClientMessage(playerid,0xFFFFFFFF,"Heres 1 Doller for your trubles ");
GivePlayerMoney(playerid, 1);
SendClientMessage(playerid,0xFFFFFFFF,"wait never mind I want that money back!");
GivePlayerMoney(playerid,-1000);
}
else
{
SendClientMessage(playerid,0xFFFFFFFF, "Haha!, The Player you are trying to asslick isn't online! noob.");
}
return 1;
}
return 0;

but when i try it ig it works fine but is says

EX: Melek is now asslicking 1251923
and every time i try it the other player is some random number
Reply
#2

pawn Код:
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[24];
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 1 Doller for your trubles ");
GivePlayerMoney(playerid, 1);
SendClientMessage(playerid,0xFFFFFFFF,"wait never mind I want that money back!");
GivePlayerMoney(playerid,-1000);
}
else
{
SendClientMessage(playerid,0xFFFFFFFF, "Haha!, The Player you are trying to asslick isn't online! noob.");
}
return 1;
}
return 0;
try now i make it so fast and not tested
Reply
#3

now when i get ig when i try my /help command its does asslicking and when i try to asslick one person it asslick someone else
Reply
#4

you script it bad .. into your gm/fs ..

use dcmd or zcmd .. is better
Reply
#5

so i need to rewrite my script just for 1 command to work? D:
Reply
#6

use dcmd only on this command ... lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)