dcmd_dardinero(playerid, params[]) { if(PlayerInfo[playerid][Nivel] >= 4) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index); if(!strlen(params[1])) return SendClientMessage(playerid, Amarillo, "* Usa: /Dardinero <Id> <Cantidad>"); if(!strlen(params[2])) return SendClientMessage(playerid, Amarillo, "* Usa: /Dararma <Id> <Cantidad>"); new player1, playername[MAX_PLAYER_NAME], admin1, adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); GivePlayerWeapon(player1, params[2], params[3]); format(string,sizeof(string), "* Administrador %s (Id:%d) te ha dado %d $.", adminname, admin1, params[2]); SendClientMessage(player1, Azul, string); PlayerPlaySound(player1, 1149, 0.0,0.0,0.0); format(string,sizeof(string), "* Le has dado a %s (Id:%d) %d $.", playername, player1, params[2]); return SendClientMessage(player1, Azul, string); } else return SendClientMessage(playerid, Rojo,"** Este jugador no estб conectado o eres tъ."); } else return SendClientMessage(playerid, Rojo,"** Debes ser Administrador nivel +4 para dar dinero a cualquier jugador."); } dcmd_dinero(playerid, params[]) { if(PlayerInfo[playerid][Nivel] >= 8) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(!strlen(params)) return SendClientMessage(playerid, Amarillo, "* Usa: /Dinero <Id> <Cantidad> para establecer el dinero de un jugador."); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); SetPlayerScore(player1, GetPlayerScore(player1) + params[2]); format(string,sizeof(string), "* Administrador %s (Id:%d) ha modificado tu dinero. Ahora tienes: %i$.", adminname, playerid, params[2]); SendClientMessage(player1, Azul, string); PlayerPlaySound(player1, 1149, 0.0,0.0,0.0); format(string,sizeof(string), "* Has modifica el dinero de %s (Id:%d). Ahora tiene: %i$.", playername, player1, params[2]); return SendClientMessage(player1, Azul, string); } else return SendClientMessage(playerid, Rojo,"** Este jugador no estб conectado o eres tъ."); } else return SendClientMessage(playerid, Rojo,"** Debes ser Administrador nivel +7 para modificar el dinero de cualquier jugador."); }
dcmd_dararma(playerid, params[]) { if(PlayerInfo[playerid][Nivel] >= 4) { new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index), tmp3 = strtok(params,Index); if(!strlen(params[1])) return SendClientMessage(playerid, Amarillo, "* Usa: /Dararma <Id> <IdArma> <Muiniciуn>"); if(!strlen(params[2])) return SendClientMessage(playerid, Amarillo, "* Usa: /Dararma <Id> <IdArma> <Muiniciуn>"); if(!strlen(params[3])) return SendClientMessage(playerid, Amarillo, "* Usa: /Dararma <Id> <IdArma> <Muiniciуn>"); new player1, playername[MAX_PLAYER_NAME], admin1, adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); GivePlayerWeapon(player1, params[2], params[3]); format(string,sizeof(string), "* Administrador %s (Id:%d) te ha dado una %s con %d de muiniciуn.", adminname, admin1, params[2], params[3]); SendClientMessage(player1, Azul, string); PlayerPlaySound(player1, 1149, 0.0,0.0,0.0); format(string,sizeof(string), "* Le has dado a %s (Id:%d) el arma %s con %d de muiniciуn.", playername, player1, params[2], params[3]); return SendClientMessage(player1, Azul, string); } else return SendClientMessage(playerid, Rojo,"** Este jugador no estб conectado o eres tъ."); } else return SendClientMessage(playerid, Rojo,"** Debes ser Administrador nivel +4 para dar armas a cualquier jugador."); }
dcmd_dardinero(playerid, params[]){
if(PlayerInfo[playerid][Nivel] >= 4){
new tmp[2][256], Index;
tmp[0] = strtok(params, Index);
tmp[1] = strtok(params, Index);
if(!strlen(tmp[0]) || !strlen(tmp[1]) || !IsNumeric(tmp[0]) || !IsNumeric(tmp[1]))return SendClientMessage(playerid, Amarillo, "* Usa: /Dardinero <Id> <Cantidad>");
new ID = strval(tmp[0]);
if(IsPlayerConnected(ID) || ID != playerid){
new monto, Name[2][MAX_PLAYER_NAME], str[128];
monto = strval(tmp[1]);
GetPlayerName(ID, Name[0], MAX_PLAYER_NAME);
GetPlayerName(playerid, Name[1], MAX_PLAYER_NAME);
format(str, 128, "* Administrador %s (Id:%d) te ha dado %d $.", Name[1], playerid, monto);
SendClientMessage(ID, Azul, str);
format(str, 128, "* Le has dado a %s (Id:%d) %d $.", Name[0], ID, monto);
SendClientMessage(playerid, Azul, str);
return GivePlayerMoney(playerid, monto);
}return SendClientMessage(playerid, Rojo, "** Este jugador no estб conectado o eres tъ.");
}return SendClientMessage(playerid, Rojo, "** Debes ser Administrador nivel +4 para dar dinero a cualquier jugador.");
}
dcmd_dararma(playerid, params[]){
if(PlayerInfo[playerid][Nivel] >= 4){
new tmp[3][256], Index;
tmp[0] = strtok(params, Index);
tmp[1] = strtok(params, Index);
tmp[2] = strtok(params, Index);
if(!strlen(tmp[0]) || !strlen(tmp[1]) || !strlen(tmp[2]) || !IsNumeric(tmp[0]) || !IsNumeric(tmp[1]))return SendClientMessage(playerid, Amarillo, "* Usa: /Dararma <Id> <Arma> <Balas>");
new arma;
if(!IsNumeric(tmp[2]))arma = GetWeaponIDFromName(tmp[2]);
else arma = strval(tmp[1]);
if(!IsValidWeapon(arma)) return SendClientMessage(playerid, Rojo, "** Arma invalida");
new ID = strval(tmp[0]);
if(IsPlayerConnected(ID) || ID != playerid){
new armaN[32], balas, Name[2][MAX_PLAYER_NAME], str[128];
GetWeaponName(arma, ArmaN, 32);
balas = strval(tmp[2]);
GetPlayerName(ID, Name[0], MAX_PLAYER_NAME);
GetPlayerName(playerid, Name[1], MAX_PLAYER_NAME);
format(str, 128, "Administrador %s (Id:%d) te ha dado una %s con %d de muiniciуn.", Name[1], playerid, armaN, balas);
SendClientMessage(ID, Azul, str);
format(str, 128, "* Le has dado a %s (Id:%d) el arma %s con %d de muiniciуn.", Name[0], ID, armaN, balas);
SendClientMessage(playerid, Azul, str);
return GivePlayerWeapon(id, arma, balas);
}return SendClientMessage(playerid, Rojo, "** Este jugador no estб conectado o eres tъ.");
}return SendClientMessage(playerid, Rojo, "** Debes ser Administrador nivel +4 para dar dinero a cualquier jugador.");
}
stock GetWeaponIDFromName(Name[])
{
if(!strfind("molotov",Name,true)) return 18;
for(new i; i<47; i++){
switch(i){
case 0,19,20,21,44,45: continue;
default:{
new name[32];
GetWeaponName(i, name, 32);
if(!strfind(name,Name,true))return i;
}
}
}return -1;
}
stock IsValidWeapon(weaponid)
{
if (weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47) return 1;
return 0;
}
stock IsNumeric(str[])
{
for (new i = 0, j = strlen(str); i < j; i++){
if (str[i] > '9' || str[i] < '0') return 0;
}
return 1;
}
new armaN[32], balas, Name[2][MAX_PLAYER_NAME], str[128];
Muchas gracias
Pude Arreglar el de dardinero y el de dinero y anda muy bien (: Para el de dinero tuve que agregar pawn Код:
error 017: undefined symbol "ArmaN" error 017: undefined symbol "id" El de arman me parece raro por que esta pawn Код:
|
Muchas gracias
Pude Arreglar el de dardinero y el de dinero y anda muy bien (: Para el de dinero tuve que agregar pawn Код:
error 017: undefined symbol "ArmaN" error 017: undefined symbol "id" El de arman me parece raro por que esta pawn Код:
|
return GivePlayerWeapon(ID, arma, balas);
Sera que lo de "id" debe ser "playerid" y no "id"
No se talvez sea eso ^^ |
GetWeaponName(arma, ArmaN, 32);
GetWeaponName(arma, armaN, 32);