16.10.2010, 23:02
Im making an /undercover command which is copied exactly off /copduty but changed "CopOnDuty" to "Undercover".
Only problem is that it sets your skin to a police skin, How could i make it pick random skins?
Would it go like this?
Then in the /undercover command change
?..
Also, how could i set up ProxDetector + a 5 minute timer on this command (5 minute timer = /rob [id] "ohh look at that i got some money, lets try again" /rob [id] "Error: You cannot rob for another 5 minutes")
Sorry for the stupid questions lately, I've spent too much time learning about error fixes and strcmp commands and not enough with any real stuff like DCMD, ZCMD, SSCANF or anything useful
Only problem is that it sets your skin to a police skin, How could i make it pick random skins?
Would it go like this?
pawn Код:
new Random;
enum random
{
{"skinid"},
{"skinid"},
{"skinid"},
{"skinid"}
etc
};
pawn Код:
SetPlayerSkin(random);
Also, how could i set up ProxDetector + a 5 minute timer on this command (5 minute timer = /rob [id] "ohh look at that i got some money, lets try again" /rob [id] "Error: You cannot rob for another 5 minutes")
pawn Код:
dcmd_rob(playerid, params[])
{
new string[128],
PlayerName[MAX_PLAYER_NAME],
OtherName[MAX_PLAYER_NAME],
id,
robamount;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: Usage: /rob [Playerid]");
{
if(ProxDetectorS(8.0, playerid))
{
else
{
robamount = GetPlayerMoney(id) / 1000;
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
GetPlayerName(id, OtherName, sizeof(OtherName));
format(string, sizeof(string), "[Succes]: You have robbed $%d from %s!", robamount, OtherName);
SendClientMessage(playerid, 0xFF0000AA, string);
format(string, sizeof(string), "[Rob]: You have been robbed by %s! He stole $%d from you!", PlayerName, robamount);
SendClientMessage(id, 0xFF0000AA, string);
GivePlayerMoney(playerid, robamount);
GivePlayerMoney(id, -robamount);
}
}
}
return 1;
}