Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Tamas on July 27, 2008, 09:35:13 pm
-
Hi
This is my transfer script:
[/quote] elseif ($2 == !testgoto) {
if ($hget(vcmp,loggedin. $+ %id) < 10) { vcmp.adminmsg %id You must be Admin Level 10 or higher to attempt this command. }
else {
if ($vcmp.nameid($3) == $null) vcmp.adminmsg %id Error: Invalid ID.
else {
if ($hget(vcmp,loggedin. $+ %id) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg %id You can't teleport someone higher level than you... }
else {
vcmp.setloc %id $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3) 0
vcmp.adminchat Transfering:[ [ $vcmp.hgetname(%id) ] ] to:[ [ $vcmp.hgetname($3) ] ]
}
}
[/quote]
I want to do that when i type !testgoto --> i can give the player Name (not the ID only.) If i give examp: !testgoto 3 its work.
But in this format: !testgoto Tomi not .
Any idea how can i use this script with name variables too?
Tam
-
I think this work:
elseif ($2 == !testgoto) {
if ($hget(vcmp,loggedin. $+ %id) < 10) { vcmp.adminmsg %id You must be Admin Level 10 or higher to attempt this command. }
else {
if ($vcmp.nameid($vcmp.hgetname($3)) == $null) vcmp.adminmsg %id Error: Invalid Name/ID.
else {
if ($hget(vcmp,loggedin. $+ %id) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg %id You can't teleport someone higher level than you... }
else {
vcmp.setloc %id $vcmp.hgetpos.x($vcmp.nameid($vcmp.hgetname($3))) $vcmp.hgetpos.y($vcmp.nameid($vcmp.hgetname($3))) $vcmp.hgetpos.z($vcmp.nameid($vcmp.hgetname($3))) 0
vcmp.adminchat Transfering:[ [ $vcmp.hgetname(%id) ] ] to:[ [ $vcmp.hgetname($3) ] ]
}
}
-
I think that might be a bit buggy :P Here is the one I use, just added in the part about not being able to teleport to someone higher than you.
elseif ($2 == !testgoto) {
if ($hget(vcmp,loggedin. $+ %id) < 10) { vcmp.adminmsg %id You must be Admin Level 10 or higher to attempt this command. }
elseif ($vcmp.nameid($3) == $null) vcmp.adminmsg %id Error: Invalid ID.
elseif ($hget(vcmp,loggedin. $+ %id) < $hget(vcmp,loggedin. $+ $3) { vcmp.adminmsg %id You can't teleport someone higher level than you... }
else {
vcmp.adminchat ** Transferring: $chr(91) $vcmp.hgetname(%id) $chr(93) To: $chr(91) $vcmp.hgetname($3) $chr(93)
vcmp.setloc $1 $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3)
}
}
That should work
Note: Not Tested
-
thijn's one worked for me.
-
Hey Force Thx 2 code ID and Name /c get id or name :D
-
nice work
-
Hmm
That code is the same what i has just another variable:
Example: elseif ($vcmp.nameid($3) == $null) vcmp.adminmsg %id Error: Invalid ID.
I has the same too, anyway if i use your code my script didnt start.
Because my script not accept "elseif" command sometimes only "if" and "else"
But i dont understound why the name variables dont work, because if i write !testgoto fghzt --> it says invalid ID, but if i write correct name than its not work, teleport me to the center of the golf stage... strange.
-
Okay i rewrited the command, and i puted to /c command.
Now its look like this:
elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if ($vcmp.hgetname($3) == $null) vcmp.adminmsg $1 Error: Invalid ID.
else {
if ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg $1 You can't transfer someone higher level admin than you. }
else { vcmp.adminchat Transfering:[ [ $vcmp.hgetname($1) ] ] to:[ [ $vcmp.hgetname($3) ] ] | vcmp.setloc $1 $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3) 0 }
}
}
Anyway its work fine but if i insert command suc: /c goto [SRS]Tomi it says invalid ID, if i repleace the ($vcmp.hgetname($3) to: ($vcmp.nameid($3) its still not work and also the server teleport me to golf stage if i use name instead number..
Any idea?
-
try:
elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
else {
if ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg $1 You can't transfer someone higher level admin than you. }
else { vcmp.adminchat Transfering:[ [ $vcmp.hgetname($1) ] ] to:[ [ $vcmp.hgetname($3) ] ] | vcmp.setloc $1 $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3) 0 }
}
}
-
This isn't work too :P
-
Try this:
elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
vcmp.adminmsg $1 You can't transfer someone higher level admin than you.
}
else {
vcmp.adminchat Transfering:[ [ $vcmp.nameid($1) ] ] to:[ [ $vcmp.nameid($3) ] ]
vcmp.setloc $1 $vcmp.hgetpos.x($vcmp.nameid($3)) $vcmp.hgetpos.y($vcmp.nameid($3)) $vcmp.hgetpos.z($vcmp.nameid($3)) 0
}
}
Note: Untested!
-
Yeah just a little modd:
elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
vcmp.adminmsg $1 You can't transfer someone higher level admin than you.
}
else {
vcmp.adminchat Transfering:[ [ $vcmp.hgetname($vcmp.nameid($1)) ] ] to:[ [ $vcmp.hgetname($vcmp.nameid($3)) ] ]
vcmp.setloc $1 $vcmp.hgetpos.x($vcmp.nameid($3)) $vcmp.hgetpos.y($vcmp.nameid($3)) $vcmp.hgetpos.z($vcmp.nameid($3)) 0
}
}
And works 100% Thanks!
-
2 More questions :D
How can i add name variables to these codes too:
elseif (($2 == bringp) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
vcmp.adminmsg $1 You can't transfer someone higher level admin than you.
}
else {
vcmp.adminchat Transfering:[ [ $vcmp.hgetname($vcmp.nameid($3)) ] ] to:[ [ $vcmp.hgetname($vcmp.nameid($1)) ] ]
vcmp.setloc $3 $vcmp.hgetpos.x($vcmp.nameid($1)) $vcmp.hgetpos.y($vcmp.nameid($1)) $vcmp.hgetpos.z($vcmp.nameid($1)) 0
}
}
And this:
elseif (($2 == setmon) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
vcmp.adminmsg $1 You can't give cash to someone higher level admin than you.
}
else {
vcmp.adminchat Admin $vcmp.hgetname($1) Gave Cash To:[ $vcmp.hgetname($3) ] Amount:[ $4- ]
vcmp.setmon $3 $4
}
}
Because i use the same code what you sent me, but thats only work with goto command.
-
use !get is bring ;)
setmon:
type /admin password (config.ini)
you are already logged admin type /setmon id ammount is easy :)
-
I know its easy but i want to add that to ingame command
-
I know its easy but i want to add that to ingame command
mm ok Use:
elseif (($2 == bringp) && ($vcmp.loggedin($1) > 4)) {
vcmp.setloc $3 $vcmp.hgetpos.x($1) $vcmp.hgetpos.y($1) $vcmp.hgetpos.z($1) 0
vcmp.adminchat **Transfering:[ $vcmp.hgetname($3) ] To:[ $vcmp.hgetname($1) ]
}
Work 100% ;)