/duty & /swatduty
#1

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 ?
Reply
#2

You store your previous skin in a variable when doing /swatduty.
When you go offduty you set the skin back to that variable.
Reply
#3

Okay can you help me with how to do it ?
Reply
#4

What is the exact problem now that you got an idea how to do it?
Reply
#5

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
Reply
#6

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 ?
Reply
#7

I suppose his answer was related to another thread.
Reply
#8

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 .
Reply
#9

Got it solved now but yeah thanks for the wise words NewYork
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)