15.04.2015, 13:31
hello guys!
i want to use Dialog Input on my server..if player joined the server they had to put the skin id the dialog box...
and after player put the skin id example: "60" i want the server set him with that skin and automatically spawn at this coordinates:
i have create my own script but not worked..after join the server..i put the skin id 12 and spawned as The truth? and spawn at Blueberry... I hope you guys can help me.. this is my code:
please fix my code!!! and yes, i will reps!
i want to use Dialog Input on my server..if player joined the server they had to put the skin id the dialog box...
and after player put the skin id example: "60" i want the server set him with that skin and automatically spawn at this coordinates:
Код:
2239.723, -1261.922, 23.9375
Код:
forward SkipSpawn(playerid);
Код:
public OnGameModeInit()
{
SetGameModeText("Blank Script");
for(new i = 1; i < 299; i++)
{
AddPlayerClass(i, 2239.723, -1261.922, 23.9375,270.7165,0,0,0,0,0,0);
}
return 1;
}
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetTimerEx("SkipSpawn",1,0,"i",playerid);
return 1;
}
Код:
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, Skin, DIALOG_STYLE_INPUT, "Change Skin", "Enter a skin ID below to get started", "Confirm", "Cancel");
return 1;
}
Код:
public SkipSpawn(playerid)
{
SpawnPlayer(playerid);
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Skin)
{
if(response)
{
new skinid, message[64];
skinid = strval(inputtext);
if(skinid < 0 || skinid > 299)
{
SendClientMessage(playerid, 0x33FF33AA, "Error: Choose a skin ID between 0 and 299.");
}
else
{
SetPlayerSkin(playerid, skinid);
format(message, sizeof(message), "You have successfully changed your skin id to %d.", skinid);
SendClientMessage(playerid, 0x33FF33AA, message);
}
}
}
return 1;
}



