Trocar para zcmd -
Kirikage - 24.06.2014
Pessoal alguem pode trocar esse cmd por zcmd Aki ta ele
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/dropgun", true) == 0
|| strcmp(cmdtext, "/dgun", true) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
if(GunID > 0 && GunAmmo != 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(dGunData[a][ObjPos][0] == 0.0)
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "You can not throw weapons at the moment, try back later!");
RemovePlayerWeapon(playerid, GunID);
dGunData[f][ObjData][0] = GunID;
dGunData[f][ObjData][1] = GunAmmo;
GetPlayerPos(playerid, dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]);
dGunData[f][ObjID] = CreateObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-1, 93.7, 120.0, 120.0);
new buffer[50];
format(buffer, sizeof(buffer), "You threw %s", GunNames[dGunData[f][ObjData][0]]);
SendClientMessage(playerid, 0x33AA3300, buffer);
}
return 1;
}
if(strcmp(cmdtext, "/pickupgun", true) == 0
|| strcmp(cmdtext, "/pgun", true) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "You are not near the weapon which you can pick up!");
DestroyObject(dGunData[f][ObjID]);
GivePlayerWeapon(playerid, dGunData[f][ObjData][0], dGunData[f][ObjData][1]);
dGunData[f][ObjPos][0] = 0.0;
dGunData[f][ObjPos][1] = 0.0;
dGunData[f][ObjPos][2] = 0.0;
dGunData[f][ObjID] = -1;
//dGunData[f][ObjData][0] = 0;
dGunData[f][ObjData][1] = 0;
new buffer[50];
format(buffer, sizeof(buffer), "You picked up %s", GunNames[dGunData[f][ObjData][0]]);
SendClientMessage(playerid, 0x33AA3300, buffer);
return 1;
}
return 0;
}
Obrigado!!
Re: Trocar para zcmd -
iD4N0N3_.x[X]x - 24.06.2014
Conversor
AQUI !
Re: Trocar para zcmd -
Kirikage - 24.06.2014
baixei mandei la e nao deu cara
Re: Trocar para zcmd -
Kirikage - 24.06.2014
Alguem troca para zcmd para min por favor
Re: Trocar para zcmd -
MultiKill - 24.06.2014
Troque:
pawn Код:
if(strcmp(cmdtext, "/nomecomando", true) == 0)
{
return 1;
}
Por:
pawn Код:
CMD:nomecomando(playerid, params[])
{
return 1;
}
E apague a callback OnPlayerCommandText
Re: Trocar para zcmd -
TioSlash - 24.06.2014
Adicione a Include zcmd no topo do seu gm eTroque a public OnPlayerCommandText por:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) SendClientMessage(playerid, -1, "Comando inexistente /comandos -q");
return 1;
}
e no final do seu gm
pawn Код:
//COMANDO
CMD:dgun(playerid, params[]) return cmd_dropgun(playerid, params);
CMD:pgun(playerid, params[]) return cmd_pickgun(playerid, params);
CMD:dropgun(playerid, params[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
if(GunID > 0 && GunAmmo != 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(dGunData[a][ObjPos][0] == 0.0)
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "You can not throw weapons at the moment, try back later!");
RemovePlayerWeapon(playerid, GunID);
dGunData[f][ObjData][0] = GunID;
dGunData[f][ObjData][1] = GunAmmo;
GetPlayerPos(playerid, dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]);
dGunData[f][ObjID] = CreateObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-1, 93.7, 120.0, 120.0);
new buffer[50];
format(buffer, sizeof(buffer), "You threw %s", GunNames[dGunData[f][ObjData][0]]);
SendClientMessage(playerid, 0x33AA3300, buffer);
}
return 1;
}
CMD:pickgun(playerid, params[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "You are not near the weapon which you can pick up!");
DestroyObject(dGunData[f][ObjID]);
GivePlayerWeapon(playerid, dGunData[f][ObjData][0], dGunData[f][ObjData][1]);
dGunData[f][ObjPos][0] = 0.0;
dGunData[f][ObjPos][1] = 0.0;
dGunData[f][ObjPos][2] = 0.0;
dGunData[f][ObjID] = -1;
//dGunData[f][ObjData][0] = 0;
dGunData[f][ObjData][1] = 0;
new buffer[50];
format(buffer, sizeof(buffer), "You picked up %s", GunNames[dGunData[f][ObjData][0]]);
SendClientMessage(playerid, 0x33AA3300, buffer);
return 1;
}
Re: Trocar para zcmd -
Kirikage - 24.06.2014
Ty emo <#
Re: Trocar para zcmd -
TioSlash - 24.06.2014
Quote:
Originally Posted by Kirikage
Ty emo <#
|
hsuahusahusahsuahsa -q