[Ajuda] comando - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] comando (
/showthread.php?tid=604302)
comando -
macacoSamp - 03.04.2016
bom pessoa criei esse comando akie
if (strcmp("/morrer", cmdtext, true) == 0)
{
SetPlayerHealth(playerid, 0);
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, 0xFFFF00FF, "Vocк morreu e perdeu R$100");
return 1;
queria colocar para quando o player desse /morrer no nascimento dele ele nascesse em outro local eu teentei colocar SetPlayerPos mais nao da ele morre no local que coloquei no setplayerpos mais ai quando nasce vai pro spawn original alguem ajuda
Re: comando -
99fe3rnando - 03.04.2016
PHP код:
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, 0.0, 0.0, 3.0);
return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerSpawn_PT
https://sampwiki.blast.hk/wiki/SetPlayerPos_PT
Re: comando -
ShOwD - 03.04.2016
Quote:
Originally Posted by 99fe3rnando
|
Isso ele daria spawn quando loga-se nesse local, eu acho que ele quer sу quando utiliza-se o cmd "/morrer"
Re: comando -
ApocaSamp - 03.04.2016
PHP код:
//TOP DA GM
new Morreu[MAX_PLAYERS];
if (strcmp("/morrer", cmdtext, true) == 0)
{
SetPlayerHealth(playerid, 0);
GivePlayerMoney(playerid, -100);
Morreu[playerid] = 1;
SendClientMessage(playerid, 0xFFFF00FF, "Vocк morreu e perdeu R$100");
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Morreu[playerid] == 1)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
return 1;
}
return 1;
}
Re: comando -
macacoSamp - 03.04.2016
eu fiz o que vc falou mais olha os erro que deu
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(26) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(169) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(172) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(174) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(177) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(179) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(181) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(185) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(18
: error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(192) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(195) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(199) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(203) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(213) : error 001: expected token: ";", but found ")"
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(213) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(213) : warning 215: expression has no effect
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(67) : warning 204: symbol is assigned a value that is never used: "Name"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Re: comando -
WooPz - 03.04.2016
PHP код:
// Essa parte vocк coloca no lugar do seu comando
if (strcmp("/morrer", cmdtext, true) == 0)
{
SetPlayerHealth(playerid, 0);
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, 0xFFFF00FF, "Vocк morreu e perdeu R$100");
SetPVarInt(playerid, "death_by_cmd", 1);
return 1;
}
// Essa parte no comeзo da public OnPlayerSpawn
if(GetPVarInt(playerid, "death_by_cmd"))
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
SetPVarInt(playerid, "death_by_cmd", 0);
return 1;
}
Re: comando -
macacoSamp - 04.04.2016
ok acertei aqui valeu
Re: comando -
F1N4L - 04.04.2016
Quote:
Originally Posted by macacoSamp
ta dando esses dois erros
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(167) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\gamemodes\BDK.pwn(171) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
a linha 167 й essa : if (GetPVarInt(playerid,"death_by_cmd"))
e a linha 171 й essa : return 1;
|
O cуdigo nгo da erro algum. Vocк colocou as funзхes corretamente onde ele inseriu as linhas comentadas?