if(strcmp(cmdtext,"/monster",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid,"INFO: Vocк estб em Parkour Monster",4000,6);
return SetVehiclePos(vehicleid,2887.6794,-2008.3571,5.7851);
}
SetPlayerPos(playerid,2887.6794,-2008.3571,5.7851);
GameTextForPlayer(playerid,"INFO: Vocк estб em Parkour Monster",4000,6);
return 1;
}
if(strcmp(cmdtext,"/sniper",true)==0)
{
SetPlayerPos(playerid,-1973.2, 218.7, 3147.8999);
GivePlayerWeapon(playerid ,34 , 100);
GameTextForPlayer(playerid,"",4000,6);
return 1;
}
new name[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid, name, sizeof(name));
format(string, 64, "O player %s usou teleporte", name);
SendClientMessageToAll(-1, string);
if(strcmp(cmdtext,"/sniper",true)==0)
{
new Name[24], Msg[128];
GetPlayerName(playerid, Name, sizeof(Name));
SetPlayerPos(playerid,-1973.2, 218.7, 3147.8999);
GivePlayerWeapon(playerid ,34 , 100);
GameTextForPlayer(playerid,"Tu pegou sua sniper",4000,6);
format(Msg, 128, "%s: Pegou sniper", Name);
SendClientMessageToAll(-1, Msg);
return 1;
}
CMD:sniper(playerid,params[])
{
new Name[24], Msg[128];
GetPlayerName(playerid, Name, sizeof(Name));
SetPlayerPos(playerid,-1973.2, 218.7, 3147.8999);
GivePlayerWeapon(playerid ,34 , 100);
GameTextForPlayer(playerid,"Tu pegou sua sniper",4000,6);
format(Msg, 128, "%s: Pegou sniper", Name);
SendClientMessageToAll(-1, Msg);
return 1;
}
if(strcmp(cmdtext,"/sniper",true)==0)
{
new Name[24], Msg[128];
GetPlayerName(playerid, Name, sizeof(Name));
SetPlayerPos(playerid,-1973.2, 218.7, 3147.8999);
GivePlayerWeapon(playerid ,34 , 100);
GameTextForPlayer(playerid,"Tu pegou sua sniper",4000,6);
format(Msg, 128, "~g~%s: Pegou sniper", Name);
GameTextForAll(Msg, 5000, 3);
return 1;
}
CMD:sniper(playerid,params[])
{
new Name[24], Msg[128];
GetPlayerName(playerid, Name, sizeof(Name));
SetPlayerPos(playerid,-1973.2, 218.7, 3147.8999);
GivePlayerWeapon(playerid ,34 , 100);
GameTextForPlayer(playerid,"Tu pegou sua sniper",4000,6);
format(Msg, 128, "~g~%s: Pegou sniper", Name);
GameTextForAll(Msg, 5000, 3);
return 1;
}
new msg[128]; format(msg, sizeof(msg), "O jogador %s foi para o Parkour de Monster",pName(playerid));//para enviar mensagem formatada SendClientMessageToAll(-1, msg);
stock pName(playerid) //stock para pegar nome do jogador usado na mensagem formatada { new Nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, Nome, MAX_PLAYER_NAME); return Nome; }
so colocar isso no comando
PHP код:
|
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(661) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
if(strcmp(cmdtext,"/monster",true)==0)
{
new name[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid, name, sizeof(name));
format(string, 64, "O player %s usou teleporte", name);
SendClientMessageToAll(-1, string);
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid,"INFO: Vocк estб em Parkour Monster",4000,6);
return SetVehiclePos(vehicleid,2887.6794,-2008.3571,5.7851);
}
SetPlayerPos(playerid,2887.6794,-2008.3571,5.7851);
GameTextForPlayer(playerid,"INFO: Vocк estб em Parkour Monster",4000,6);
return 1;
}
Primeiro ti recomendo usar ZCMD, mas de qualquer jeito ti recomendo usar SendClientMessageToAll digamos ficaria assim:
PHP код:
PHP код:
PHP код:
PHP код:
https://sampwiki.blast.hk/wiki/GameTextForAll https://sampwiki.blast.hk/wiki/SendClientMessageToAll |
if(strcmp(cmdtext, "/lv", true) == 0) { // ...code... }