07.02.2017, 09:01
(
Последний раз редактировалось kloning1; 07.02.2017 в 09:04.
Причина: update!
)
I do not understand what you want, but I think maybe this will help you
PHP код:
CMD:challenge(playerid, params[])
{
new id;
if(sscanf(params,"d", id)) {
SCM(playerid, -1, "usage: /challenge [playerid]");
}
else {
if(onCheck[id] == false) { // checking id already on challenge or not
onCheck[id] = true;
SCM(id, -1, "you have set to challenge mode"); // send id message
new str[128];
format(str,sizeof(str),"you have set %s to challenge mode", GetName(id));
SCM(playerid, -1, str);
SetPlayerCheckpoint(id, 1982.6150, -220.6680, -0.2432, 3.0); // setting id checkpoint
}
else {
SCM(playerid, -1, "player is already on challenge mode");
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
onCheck[playerid] = false; // set challenge to false
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(onCheck[playerid]) { // if it's true
GivePlayerMoney(playerid, 1000);
DisablePlayerCheckpoint(playerid);
onCheck[playerid] = false;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(onCheck[playerid]) { // check if id already on challenge
SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
SCM(id, -1, "you have enter challenge mode");
}
else if(!onCheck[playerid]) {
DisablePlayerCheckpoint(playerid); // disable checkpoint
}
return 1;
}