/duty & /swatduty - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /duty & /swatduty (
/showthread.php?tid=124431)
/duty & /swatduty -
Chivava - 30.01.2010
Hello, i've made this 2 commands called /duty and /swatduty but theres a little problem.. When i do /swatduty i get skin 285 ( setplayerskin bla bla )
But when i go off swat duty its still there, how is it possible to make it back to civilian skin ?
I example lets say.. You have skin id 46 then you go /swatduty and gets skin id 285 then you go off duty, how can i then get skin 46 back ?
It must be the skin that the player had before he went on duty..
Can anyone please help me ?
Re: /duty & /swatduty -
ray187 - 30.01.2010
You store your previous skin in a variable when doing /swatduty.
When you go offduty you set the skin back to that variable.
Re: /duty & /swatduty -
Chivava - 30.01.2010
Okay can you help me with how to do it ?
Re: /duty & /swatduty -
ray187 - 30.01.2010
What is the exact problem now that you got an idea how to do it?
Re: /duty & /swatduty -
typedef - 30.01.2010
USERDB = db_open("Database1.db");
new query[256];
format(query,sizeof(query),"INSERT INTO `users` (username) VALUES ('dkw')");
db_free_result(db_query(USERDB,query));
db_close(USERDB);
Now for some reason it wont insert into the database
USERDB is defined up into the top of the file
Re: /duty & /swatduty -
Chivava - 30.01.2010
Quote:
Originally Posted by typedef
USERDB = db_open("Database1.db");
new query[256];
format(query,sizeof(query),"INSERT INTO `users` (username) VALUES ('dkw')");
db_free_result(db_query(USERDB,query));
db_close(USERDB);
Now for some reason it wont insert into the database
USERDB is defined up into the top of the file
|
What do you mean by that ? Should i #define USERDB and then what ?
Re: /duty & /swatduty -
ray187 - 30.01.2010
I suppose his answer was related to another thread.
Re: /duty & /swatduty -
NewYorkRP - 31.01.2010
You use LA-RP.. so it's simple.
When it sets your skin to 285 (SWAT)
Do not let it set that forever.
If it has
Код:
PlayerInfo[playerid][pModel] = 285;
- Remove it!
And when you /swatduty OFF, Simply add
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
Done! Simple as that

.
What it means:
It does not save the SWAT Skin, assuming it saves your other skin before you /swatduty (/setskin saves it.)
So, it loads back the pModel (Which you didn't save using the SWAT Cmd.)
Simple as

.
Re: /duty & /swatduty -
Chivava - 31.01.2010
Got it solved now but yeah thanks for the wise words NewYork