28.06.2016, 03:56
Alguem ajuda a por o limite de 1000 R$ no /transferir
Quote:
if(strcmp(cmd, "/transferir", true) == 0) { if(PlayerInfo[playerid][pLevel] > 4){ new giveplayerid; new moneys; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; new playermoney2; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Vermelho, "Digite: /transferir [id] [quantia]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Vermelho, "Digite: /transferir [id] [quantia]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { if (GetDistanceBetweenPlayers(giveplayerid,playerid) < 21){ GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); playermoney2 = GetPlayerGrana(playerid); if (moneys > 0 && playermoney2 >= moneys) { GivePlayerGrana(playerid, (0 - moneys)); GivePlayerGrana(giveplayerid, moneys); format(string, sizeof(string), "Vocк enviou a %s (%d) a importвncia de $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, 0xD9D900AA, string); format(string, sizeof(string), "Vocк recebeu $%d de %s (%d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, 0xD9D900AA, string); }else{ SendClientMessage(playerid, Vermelho, "| ERRO | Valor invбlido."); } } else { SendClientMessage(playerid, Vermelho, "| ERRO | Longe demais, chegue mais perto!"); } } else { SendClientMessage(playerid, Vermelho, "| ERRO | Jogador nгo conectado"); } }else{ SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem level suficiente , vocк precisa ter level maior ou igual a 5!"); } return 1; } |