if(strcmp(cmd, "/arcas", true) == 0) { if(PlayerInfo[playerid][pMember] == 5 && PlayerInfo[playerid][pRank] == 6 || PlayerInfo[playerid][pAdmin] == 4) { tmp = strtokex(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5-7][Nombre] [Cantidad]"); return 1; } for(new i = 0; i < sizeof(ArcasInfo); i++) { new llave = strval(tmp); if (ArcasInfo[i][aId] == llave) { tmp2 = strtokex(cmdtext, idx); if(!strlen(tmp2)) { SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5-7][Nombre] [Cantidad]"); SendClientMessage(playerid, AzulClaro, "Arcas: Ver, Sacar, Depositar"); return 1; } if(strcmp(tmp2,"Ver",true) == 0) { new dueno[15]; if(ArcasInfo[i][aOwner] == 0) dueno = "Gobierno"; else if(ArcasInfo[i][aOwner] == 1) dueno = "LSPD"; else if(ArcasInfo[i][aOwner] == 2) dueno = "LSMD"; else if(ArcasInfo[i][aOwner] == 3) dueno = "LSTD"; else if(ArcasInfo[i][aOwner] == 4) dueno = "San News"; else if(ArcasInfo[i][aOwner] == 5) dueno = "Gobierno"; else if(ArcasInfo[i][aOwner] == 7) dueno = "LSJD"; else if(ArcasInfo[i][aOwner] == 10) dueno = "Idlewod"; else if(ArcasInfo[i][aOwner] == 11) dueno = "Las Flores"; else if(ArcasInfo[i][aOwner] == 12) dueno = "Jefferson"; else if(ArcasInfo[i][aOwner] > 0) format(dueno,sizeof(dueno),"%d",ArcasInfo[i][aOwner]); format(string,sizeof(string), "------%s------[%d]", ArcasInfo[i][aNameArca], ArcasInfo[i][aId]); SendClientMessage(playerid, Naranja, string); format(string,sizeof(string), "Dueсo: %s ", dueno); SendClientMessage(playerid, AmarilloClaro, string); format(string,sizeof(string), "Total $$: %d$",ArcasInfo[i][aDinero]); SendClientMessage(playerid, AmarilloClaro, string); if(ArcasInfo[i][aId] == 2) { format(string,sizeof(string), "Sangre: %d",ArcasInfo[i][aSangre]); SendClientMessage(playerid, AmarilloClaro, string); } if(ArcasInfo[i][aId] == 4) { format(string,sizeof(string), "Fondos: %d$",ArcasInfo[i][aFondos]); SendClientMessage(playerid, AmarilloClaro, string); } } if(strcmp(tmp2,"Sacar",true) == 0) { new money; tmp3 = strtokex(cmdtext, idx); money = strval(tmp3); if(!strlen(tmp3) || !IsNumeric(tmp3)) { SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5][Nombre] [Cantidad]"); return 1; } if(ArcasInfo[i][aDinero] < money) { SendClientMessage(playerid, Rojo, "* Cantidad Incorrecta."); return 1; } ArcasInfo[i][aDinero] -= money; SaveArcas(i); SafeGivePlayerMoney(playerid, money); format(string,sizeof(string), "Has sacado: %d$", money); SendClientMessage(playerid, AmarilloClaro, string); } if(strcmp(tmp2,"Depositar",true) == 0) { new money; tmp3 = strtokex(cmdtext, idx); money = strval(tmp3); if(!strlen(tmp3) || !IsNumeric(tmp3)) { SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5][Nombre] [Cantidad]"); return 1; } if(SafeGetPlayerMoney(playerid) >= money) { ArcasInfo[i][aDinero] += money; SaveArcas(i); SafeGivePlayerMoney(playerid, - money); format(string,sizeof(string), "Has depositado: %d$", money); SendClientMessage(playerid, AmarilloClaro, string); } else { SendClientMessage(playerid, Rojo, "* Cantidad incorrecta"); } } } } } else { SendClientMessage(playerid, Rojo, "No perteneces a una facciуn pъblica o no eres un alto rango"); } return 1; }
eso es un bug de gta...
para lo otro usa esta condiciуn if(strlen(tmp3) > 4) return 0; |
if(strcmp(cmd, "/crearcoche", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] < 3) { SendClientMessage(playerid, Rojo, "* No formas parte del Staff!"); return 1; } if(strcmp("Palmero", PlayerInfo[playerid][pAdName], true) == 0 || strcmp("Palmero2", PlayerInfo[playerid][pAdName], true) == 0) { tmp = strtokex(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Blanco, "USO: /crearcoche [ModelID] [Color1] [Color2]"); return 1; } new car; car = strval(tmp); if(car < 400 || car > 611) { SendClientMessage(playerid, Rojo, "* Nъmero de vehнculo entre 400 y 611!"); return 1; } tmp = strtokex(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Blanco, "USO: /crearcoche [ModelID] [Color1] [Color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, Rojo, "* Nъmero de color no puede ser menor de 0 y mayor de 126!"); return 1; } tmp = strtokex(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Blanco, "USO: /crearcoche [ModelID] [Color1] [Color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, Rojo, "* Nъmero de color no puede ser menor de 0 y mayor de 126!"); return 1; } new Float:X, Float:Y, Float:Z, Float:Angle; enfrente (playerid, 5.0, X, Y, Z, Angle); CreateLLLCar(playerid, car, X, Y, Z, Angle, color1, color2); // parбmetro NOEXISTE para indicar que es de admin format(string, sizeof(string), "* Vehнculo %d creado.", TotalVeh); SendClientMessage(playerid, Amarillo, string); } else { SendClientMessage(playerid, Rojo, "Comando inexistente"); return 1; } } return 1; }