Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: aledark24 on March 18, 2013, 03:21:39 pm
-
[pawn]new Wallet[MAX_PLAYERS];[/pawn]
"Gups or Fc version"
[pawn] else if(strcmp(cmd,"rob",true) == 0) {
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if(Wallet[plr] == 1) {
SendClientMessage(playerid,0xAA3333AA,"You not cant rob the same player again!");
}
if ( !strlen( tmp ) ) SendClientMessage( playerid, 0xFFFF00AA, "Write: /c rob [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, 0xAA3333AA, "Error: Unknown Player" );
else{
if(Wallet[plr] == 0) {
new Float:XR, Float:YR, Float:ZR;
GetPlayerPos(playerid,XR,YR,ZR);
if(PlayerToPoint(3.0,plr,XR,YR,ZR)) {
format( szMsg, sizeof( szMsg ), "%s steal the wallet of %s", gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll( 0xFFFF00AA, szMsg );
IncPlayerHandCash(playerid,200);
DecPlayerHandCash(plr,200);
Wallet[plr] = 1;
SetPlayerMarker(playerid,15);
}
else SendClientMessage(playerid,0xAA3333AA,"Need to be closer for rob");
}
}
}
return 1;
}[/pawn]
[pawn]public OnPlayerDeath(playerid, killerid, reason, bodypart)
{
Wallet[playerid] = 0;[/pawn]
[pawn]public OnPlayerDisconnect(playerid, reason)
{
Wallet[playerid] = 0;[/pawn]
All scripts version
[pawn] else if(strcmp(cmd,"rob",true) == 0) {
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if(Wallet[plr] == 1) {
SendClientMessage(playerid,0xAA3333AA,"You not cant rob the same player again!");
}
if ( !strlen( tmp ) ) SendClientMessage( playerid, 0xFFFF00AA, "Write: /c rob [Nick/ID]" );
else{
if(Wallet[plr] == 0) {
new Float:XR, Float:YR, Float:ZR;
GetPlayerPos(playerid,XR,YR,ZR);
if(PlayerToPoint(3.0,plr,XR,YR,ZR)){
if ( GetPlayerMoney( plr ) > 199 ) {
format( szMsg, sizeof( szMsg ), "%s steal the wallet of %s", gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll( 0xFFFF00AA, szMsg );
format( szMsg, sizeof( szMsg ),"You steal $ 200 of the player %s",gPlayers[plr]);
SendClientMessage(playerid, 0xFFFF00AA, szMsg );
SetPlayerMoney(plr,GetPlayerMoney(plr) - 200);
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 200);
Wallet[plr] = 1;
}
if ( GetPlayerMoney( plr ) < 199 ){
SendClientMessage(playerid,0xFFFF00AA,"This player not have money to rob");
SetPlayerMarker(playerid,15);
Wallet[plr] = 0;
}
}
else SendClientMessage(playerid,0xAA3333AA,"Need to be closer for rob");
}
}
}
return 1;
}[/pawn]
-
Na lo robaste, no eres capaz de hacer tu propio comando, solo le robas al script de madara (Warchiefs)
-
Sorry alejandro. You may edit and add "this is for GUPS"
-
Sorry alejandro. You may edit and add "this is for GUPS"
if you are stup_ _ ....
and not see ...
if you not have IncPlayerHandCash or DecPlayerHandCash
is you problem, but have two system
SetPlayerMoney -200
and SetPlayerMoney + 200
so...
you only need remove
IncPlayerHandCash and DecPlayerHandCash
Note: I have a server from 0
Only i put the register system of gups, but have my own system of
IncPlayerHandCash and DecPlayerHandCash and bank System, if you need my system only talk whit me
-
Na lo robaste, no eres capaz de hacer tu propio comando, solo le robas al script de madara (Warchiefs)
TomiJaja , EN Ningun warchiefs sale comando "rob" , al parecer Tu lo unico que sabes es , Cojer 1 comando y traducirlo y cojerlo para ti , Repeta Lo rango.
-
What happens if the victim player doesn't have 200$ ? It will still take + give that amount.
+ Why you used both functions that increase/decrease the money of a player ?
IncPlayerHandCash(playerid,200);
DecPlayerHandCash(plr,200);
SetPlayerMoney(plr,GetPlayerMoney(plr) - 200);
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 200);
This couple of lines will take $200 from the victim once (at the second line: "DecPlayerHandCash(plr,200);") and will take again this amoun (200 $) because you have used this line: "SetPlayerMoney(plr,- 200);" . And the robber will increase $400 not $200 by robbing that player.
+ just $200 will be saved in the database, the rest of $200 will be just in the HUD, so just $200 will be usable.
-
Who stu*** now ?
-
What happens if the victim player doesn't have 200$ ? It will still take + give that amount.
+ Why you used both functions that increase/decrease the money of a player ?
IncPlayerHandCash(playerid,200);
DecPlayerHandCash(plr,200);
SetPlayerMoney(plr,GetPlayerMoney(plr) - 200);
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 200);
This couple of lines will take $200 from the victim once (at the second line: "DecPlayerHandCash(plr,200);") and will take again this amoun (200 $) because you have used this line: "SetPlayerMoney(plr,- 200);" . And the robber will increase $400 not $200 by robbing that player.
+ just $200 will be saved in the database, the rest of $200 will be just in the HUD, so just $200 will be usable.
Because not all players have DecPlayerHandCash And IncPlayerHandCash, so this reason is "not have public" Deleted inc and dec :p
and i posted my commands but always update and keep the latest update.....
-
Because not all players have DecPlayerHandCash And IncPlayerHandCash, so this reason is "not have public" Deleted inc and dec :p
and i posted my commands but always update and keep the latest update.....
I'm talking about players that have both functions implemented. (DecPlayerHandCash & IncPlayerHandCash)
I suggest you to give more details in the first post, or to make 2 versions: one for GUPS and one for standard scripts. (detailed too)
+
What happens if the victim player doesn't have 200$ ? It will still take + give that amount.
-
Because not all players have DecPlayerHandCash And IncPlayerHandCash, so this reason is "not have public" Deleted inc and dec :p
and i posted my commands but always update and keep the latest update.....
I'm talking about players that have both functions implemented. (DecPlayerHandCash & IncPlayerHandCash)
I suggest you to give more details in the first post, or to make 2 versions: one for GUPS and one for standard scripts. (detailed too)
+
What happens if the victim player doesn't have 200$ ? It will still take + give that amount.
ok ok
[pawn] else if(strcmp(cmd,"rob",true) == 0) {
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if(Wallet[plr] == 1) {
SendClientMessage(playerid,0xAA3333AA,"You not cant rob the same player again!");
}
if ( !strlen( tmp ) ) SendClientMessage( playerid, 0xFFFF00AA, "Write: /c rob [Nick/ID]" );
else{
if(Wallet[plr] == 0) {
new Float:XR, Float:YR, Float:ZR;
GetPlayerPos(playerid,XR,YR,ZR);
if(PlayerToPoint(3.0,plr,XR,YR,ZR)){
if ( GetPlayerMoney( plr ) > 199 ) {
format( szMsg, sizeof( szMsg ), "%s steal the wallet of %s", gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll( 0xFFFF00AA, szMsg );
format( szMsg, sizeof( szMsg ),"You steal $ 200 of the player %s",gPlayers[plr]);
SendClientMessage(playerid, 0xFFFF00AA, szMsg );
SetPlayerMoney(plr,GetPlayerMoney(plr) - 200);
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 200);
Wallet[plr] = 1;
}
if ( GetPlayerMoney( plr ) < 199 ){
SendClientMessage(playerid,0xFFFF00AA,"This player not have money to rob");
SetPlayerMarker(playerid,15);
Wallet[plr] = 0;
}
}
else SendClientMessage(playerid,0xAA3333AA,"Need to be closer for rob");
}
}
}
return 1;
}[/pawn]
is better now sseebbyy??
-
(http://images.cooltext.com/3001961.png)