30.12.2010, 12:12
/startjob -> IsPlayerInRangeOfPoint -> Set Checkpoint
Enter Checkpoint -> IsPlayerInRangeOfPoint -> Pay
Enter Checkpoint -> IsPlayerInRangeOfPoint -> Pay
if(PlayerInfo[playerid][pMask] == 1)
{
//Code here
return 1;
}
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Cars","Car 1 - Price\r\nCar 2 - Price\r\nCar 3 - Price","Buy", "Cancel");
//Under OnGameModeinit
SetTimer("TaxTimer",3600000,true);
//anywhere in the script just not in another callback.
forward TaxTimer();
public TaxTimer()
{
for(new j;j<MAX_PLAYERS;j++)
{
new tax;
tax = GetPlayerMoney(j) / 5;
GivePlayerMoney(j, -tax);
}
return 1;
}
CMD:me(playerid, params[])
{
new
pName[MAX_PLAYER_NAME],
String[128];
if(isnull(params)) return SendClientMessage(playerid, yellow, "/me [text]");
GetPlayerName(playerid, pName, sizeof(pName));
format(String, sizeof(String), "* %s %s *", pName, params);
return SendClientMessageToAll(0xFFFFFFFF, String);
}
pawn Код:
|
CMD:me(playerid, params[])
{
new
pName[MAX_PLAYER_NAME],
String[128];
if(isnull(params)) return SendClientMessage(playerid, yellow, "|| ~Usage: /me [TEXT]~ ||");
new string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string,sizeof(string),"%s: %s",RemoveUnderScore(playerid),text);
return SendClientMessageToAll(0xFFFFFFFF, String);
}
//-
stock RemoveUnderScore(playerid){
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++){
if(name[i] == '_') name[i] = ' ';}
return name;}
Im Requesting 2 commands...
/heal [PLAYERID] /ban [PLAYERID] [REASON] in strcmp.. nor dcmd or others.. |
if(strcmp("/ban", cmd, true) == 0)
{
if(PlayerInfo[playerid][pAdminLevel] > 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /ban [id] [reason]");
}
new reason[128];
reason = strrest(cmdtext, idx);
if (!strlen(reason)) SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /ban [id] [reason]");
new id = strval(tmp);
new pid = playerid;
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_GRAY,"AdmCmd: This player is not online!");
}
new globalmsg[100];
new adminid[MAX_PLAYERS], victimid[MAX_PLAYERS];
GetPlayerName(pid, adminid, sizeof(victimid));
GetPlayerName(id, victimid, sizeof(victimid));
format(globalmsg,sizeof(globalmsg),"AdmWarn: Administrator %s has banned player %s [%s]",adminid,victimid, reason);
SendClientMessageToAll(COLOR_LIGHTBLUE,globalmsg);
PlayerInfo[id][pAccountLocked] = 1;
BanEx(id, reason);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
return 1;
}
}
stock strrest(const string[], index)
{
new length = strlen(string),offset = index,result[128];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)) && (string[index] > '\r'))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}