COMMAND:ld(playerid, params[])//--------------------------------------// { if (player_preso_haha[playerid]) return false; new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, sizeof(nome)); SetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid,1095.03808593,-647.37994384,113.64843750); format(stringa, sizeof(stringa), "{e70808}%s{e2d009} Foi Para a Casa de (/ld)", nome); SendClientMessageToAll(Amarelo, stringa); new nomeAll[MAX_PLAYER_NAME]; for(new i = 0; i < MAX_PLAYERS; i++) { GetPlayerName(i, nomeAll, MAX_PLAYER_NAME); if (!strcmp(nomeAll, "Dutrazor", false) || !strcmp(nomeAll, "Lateamcraft", false) && IsPlayerConnected(i)) { if (playerid == i) { return 1; } else { GivePlayerMoney(i, 100000); } } } GivePlayerMoney(playerid,-200000); return 1; }
COMMAND:ld(playerid, params[])//--------------------------------------//
{
if (player_preso_haha[playerid]) return false;
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,1095.03808593,-647.37994384,113.64843750);
format(stringa, sizeof(stringa), "{e70808}%s{e2d009} Foi Para a Casa de (/ld)", nome);
SendClientMessageToAll(Amarelo, stringa);
new
playerDutrazor,
playerLateamcraft,
playerFound,
nomeAll[MAX_PLAYER_NAME];
for(new s = GetMaxPlayers(), i; i < s; i++) {
GetPlayerName(i, nomeAll, MAX_PLAYER_NAME);
if (!strcmp(nomeAll, "Dutrazor", false)) {
if (IsPlayerConnected(i)) {
playerDutrazor = i;
playerFound++;
}
}
if (!strcmp(nomeAll, "Lateamcraft", false)) {
if (IsPlayerConnected(i)) {
playerLateamcraft = i;
playerFound++;
}
}
}
if (playerid == playerDutrazor || playerid == playerLateamcraft)
return 1;
else if (playerFound == 1)
{
playerFound = 0;
GivePlayerMoney(playerDutrazor, 100000);
return 1;
}
else if (playerFound == 2)
{
playerFound = 0;
GivePlayerMoney(playerDutrazor, 100000);
GivePlayerMoney(playerLateamcraft, 100000);
return 1;
}
GivePlayerMoney(playerid,-200000);
return 1;
}
Isso й bem simples de resolver, basta separar as checagens e armazenar os ids de ambos, e entгo atribuir os valores pelos IDs deles.
pawn Код:
|
COMMAND:ld(playerid, params[])
{
if (player_preso_haha[playerid]) return false;
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,1095.03808593,-647.37994384,113.64843750);
format(stringa, sizeof(stringa), "{e70808}%s{e2d009} Foi Para a Casa de (/ld)", nome);
SendClientMessageToAll(Amarelo, stringa);
new
playerDutrazor = -255,
playerLateamcraft = -255,
playerFound = 0,
nomeAll[MAX_PLAYER_NAME];
for(new s = GetMaxPlayers(), i; i < s; i++) {
GetPlayerName(i, nomeAll, MAX_PLAYER_NAME);
if (!strcmp(nomeAll, "Dutrazor", false)) {
if (IsPlayerConnected(i)) {
playerDutrazor = i;
playerFound++;
}
}
if (!strcmp(nomeAll, "Lateamcraft", false)) {
if (IsPlayerConnected(i)) {
playerLateamcraft = i;
playerFound++;
}
}
}
if (playerid == playerDutrazor || playerid == playerLateamcraft)
return 1;
else if (playerFound == 1)
{
playerFound = 0;
GivePlayerMoney(playerDutrazor, 100000);
GivePlayerMoney(playerid,-200000);
return 1;
}
else if (playerFound == 2)
{
playerFound = 0;
GivePlayerMoney(playerDutrazor, 100000);
GivePlayerMoney(playerLateamcraft, 100000);
GivePlayerMoney(playerid,-200000);
return 1;
}
return 1;
}