How to change Walk Style and Creteobject - 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: How to change Walk Style and Creteobject (
/showthread.php?tid=422078)
How to change Walk Style and Creteobject -
McDavidson - 12.03.2013
Okey i use the Grandlarnce gamemode and i need to change so i walk like CJ..
And! can you help me i want to createobject in game i rcon logged in. In Rcon
Re: How to change Walk Style and Creteobject -
IgrexolonO - 12.03.2013
#1.
Код:
public OnGameModeInit()
{
UsePlayerPedAnims();
return 1;
}
Re: How to change Walk Style and Creteobject -
McDavidson - 12.03.2013
Thanks. and how can i make objects in game
Re: How to change Walk Style and Creteobject -
IgrexolonO - 12.03.2013
https://sampwiki.blast.hk/wiki/CreateObject
Re: How to change Walk Style and Creteobject -
Scrillex - 12.03.2013
You want with saving it or without saving? I will give you an example in saving and loading fighting styles and you could use the same as that... In your waling styles!
So yeah here will be code under OnDialogReponse:
pawn Код:
if (dialogid == fighting)
{
if (response)
{
if (listitem == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
pInfo[playerid][Fighting] = 0;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Normal");
}
if (listitem == 1)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
pInfo[playerid][Fighting] = 1;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Boxing");
}
if (listitem == 2)
{
pInfo[playerid][Fighting] = 2;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - KungFu");
}
if (listitem == 3)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
pInfo[playerid][Fighting] = 3;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Knee Head");
}
if (listitem == 4)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
pInfo[playerid][Fighting] = 4;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Grab Kick");
}
if (listitem == 5)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
pInfo[playerid][Fighting] = 5;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have changed your fighting style to - Elbow");
}
}
else
{
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You selected 'cancel'");
}
}
Now we need loading: public OnPlayerSpawn(playerid)
pawn Код:
if(pInfo[playerid][Fighting] == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
}
if(pInfo[playerid][Fighting] == 1)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
}
//etc etc etc!
Only remember to create on enum
Fighting and in rest of saving loading code..
like: new Fighting;