Posts: 1,745
Threads: 252
Joined: Dec 2011
Reputation:
0
ok i made i cmd and theres no error while compiling it but when i go in game and do /rob (thats the cmd) it says server unkown command
Posts: 1,745
Threads: 252
Joined: Dec 2011
Reputation:
0
do you mean the code? if so here it is:
#include <a_samp>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" just some commmands :P");
print("--------------------------------------\n");
return 1;
}
forward OnPlayerCommandText(playerid, cmdtext[]);
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(rob, 3, cmdtext);
return 0;
}
dcmd_rob(playerid, params[])
{
new id;
if (strlen(params))
{
id=strlen(params);
if (IsPlayerConnected(id))
{
GivePlayerMoney(id, 100);
SetPlayerScore(id, 5);
SendClientMessage(playerid, 0x00FF00AA, "you have sucessfully robed someone! score+5");
SendClientMessage(playerid, 0x00FF00AA, "player robbed");
}
else
{
SendClientMessage(playerid, 0x00FF00AA, "player not found !");
}
}
else
{
SendClientMessage(playerid, 0x00FF00AA, "usage:/rob [id]");
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
Posts: 1,745
Threads: 252
Joined: Dec 2011
Reputation:
0
bump theres got to be someone that know how to fix ma problem