CMD:9mm(playerid, params[], help)
{
if (!IsPlayerAdmin(playerid)) return 0;
GivePlayerWeapon(playerid, 22, 99999);
return 1;
}
CMD:giveweapon(playerid,params[])
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return
SendClientMessage(playerid, COLOR, "Usage: /giveweapon [PlayerID] [Weapon ID/Name] [Ammo]") &&
SendClientMessage(playerid, COLOR, "Function: Will give a weapon to a specified player");
new player1 = strval(tmp);
new weap, ammo, WeapName[32];
new string[128];
if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500;
else ammo = strval(tmp3);
if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2);
else weap = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(!IsValidWeapon(weap))
return SendClientMessage(playerid,red,"ERROR: Invalid Weapon ID");
GetWeaponName(weap,WeapName,32);
format(string, sizeof(string), "== You have given \"%s\" a %s (%d) with %d rounds of Ammo ", PlayerName2(player1), WeapName, weap, ammo);
SendClientMessage(playerid,COLOR,string);
if(player1 != playerid)
{
format(string,sizeof(string),"== \"%s\" has given you a %s (%d) with %d rounds of Ammo ", PlayerName2(playerid), WeapName, weap, ammo);
SendClientMessage(player1,COLOR,string);
}
return GivePlayerWeapon(player1, weap, ammo);
}
return 1;
}
C:\Users\Equipo\Desktop\Samportal RolePlay Prueba\gamemodes\SPRP.pwn(1389) : error 017: undefined symbol "IsNumeric" C:\Users\Equipo\Desktop\Samportal RolePlay Prueba\gamemodes\SPRP.pwn(1391) : error 017: undefined symbol "IsNumeric" C:\Users\Equipo\Desktop\Samportal RolePlay Prueba\gamemodes\SPRP.pwn(1391) : error 017: undefined symbol "GetWeaponIDFromName" C:\Users\Equipo\Desktop\Samportal RolePlay Prueba\gamemodes\SPRP.pwn(1395) : error 017: undefined symbol "IsValidWeapon" C:\Users\Equipo\Desktop\Samportal RolePlay Prueba\gamemodes\SPRP.pwn(139 : error 017: undefined symbol "PlayerName2" C:\Users\Equipo\Desktop\Samportal RolePlay Prueba\gamemodes\SPRP.pwn(1402) : error 017: undefined symbol "PlayerName2" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors. |
CMD:a9mm(playerid,params[])
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return
SendClientMessage(playerid, COLOR_ROJO, "Usage: /giveweapon [PlayerID] [Weapon ID/Name] [Ammo]") &&
SendClientMessage(playerid, COLOR_ROJO, "Function: Will give a weapon to a specified player");
new player1 = strval(tmp);
new weap, ammo, WeapName[32];
new string[128];
if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500;
else ammo = strval(tmp3);
if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2);
else weap = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(!IsValidWeapon(weap))
return SendClientMessage(playerid,COLOR_ROJO,"ERROR: Invalid Weapon ID");
GetWeaponName(weap,WeapName,32);
format(string, sizeof(string), "== You have given \"%s\" a %s (%d) with %d rounds of Ammo ", PlayerName2(player1), WeapName, weap, ammo);
SendClientMessage(playerid,COLOR_ROJO,string);
if(player1 != playerid)
{
format(string,sizeof(string),"== \"%s\" has given you a %s (%d) with %d rounds of Ammo ", PlayerName2(playerid), WeapName, weap, ammo);
SendClientMessage(player1,COLOR_ROJO,string);
}
return GivePlayerWeapon(player1, 22, 99999);
}
return 1;
}
CMD:9mm(playerid, params[], help)
{
if (!IsPlayerAdmin(playerid)) return 0;
if(!IsPlayerConnected(strval(params))) SendClientMessage(playerid, -1, "Jugador no conectado.");
GivePlayerWeapon(strval(params), 22, 99999);
return 1;
}
Dijo guiate de йl, no que copies el cуdigo.
pawn Код:
|
Bajate el plugin sscanf y su include te van a hacer las cosas muchнsimas mбs fбciles.
|
Dices que no me incumbe pero esto es un foro pъblico que cualquiera puede comentar. Si creas un tуpico pidiendo ayuda es estъpido decir que no me meta porque no me incumbe. No te enojes porque no te ayudarб.
Ademбs no soy adivino como para saber que editу el comentario (no ando muy pendiente de ello). El cуdigo que te dejй es correcto, verificalo, y deja de lado la forma en la que me expreso porque esa es mi naturaleza. |