Problem with a cmd - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with a cmd (
/showthread.php?tid=363831)
Problem with a cmd -
adrianxd - 28.07.2012
Hi guys I am creating a cmd
that is so
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/startbase", cmdtext, true, 10) == 0)
{
if (IsPlayerAdmin(playerid))
ShowPlayerDialog(playerid,14041,DIALOG_STYLE_LIST,"{FF0000}Inicia una Base ","\n{00c4fa}Base: {ff0000}1 ","Accept","Cancel");
return 1;
}
return 0;
}
in
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==14041) {
if(response) {
if(listitem==0) { // Dedfensa
if(gTeam[playerid] == TEAM_1)
{
SetPlayerPos(playerid,2471.39990234,-1705.00000000,13.19999981);
SetPlayerSkin(playerid,199);
}
}
else if(gTeam[playerid] == TEAM_2)
{
SetPlayerPos(playerid,2443.50000000,-1555.90002441,23.60000038);
SetPlayerSkin(playerid,199);
}
}
}
return 1;
}
That problem is the teams indicated wing position will not.
help
Respuesta: Problem with a cmd -
HarlemSAMP - 28.07.2012
Sencillo, remueve tle gTeams y utiliza tu skin si es restricted, asi no necesitas el gteam y solo serб por skin.
Re: Problem with a cmd -
milanosie - 28.07.2012
This is what you have
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==14041)
{
if(response)
{
if(listitem==0)
{ // Dedfensa
if(gTeam[playerid] == TEAM_1)
{
SetPlayerPos(playerid,2471.39990234,-1705.00000000,13.19999981);
SetPlayerSkin(playerid,199);
}
}
else if(gTeam[playerid] == TEAM_2)
{
SetPlayerPos(playerid,2443.50000000,-1555.90002441,23.60000038);
SetPlayerSkin(playerid,199);
}
}
}
return 1;
}
This is what you must have
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==14041)
{
if(response)
{
if(listitem==0)
{ // Dedfensa
if(gTeam[playerid] == TEAM_1)
{
SetPlayerPos(playerid,2471.39990234,-1705.00000000,13.19999981);
SetPlayerSkin(playerid,199);
}
else if(gTeam[playerid] == TEAM_2)
{
SetPlayerPos(playerid,2443.50000000,-1555.90002441,23.60000038);
SetPlayerSkin(playerid,199);
}
}
}
}
return 1;
}
Fix your indentation and the problem is visible,
Test it out, second code should work.